/****************************************************
 * created by lei.he on 2020/07/28 for entry file
 ****************************************************/
// 引入express框架 path路径
const express = require('express'),
      path = require('path')
// 实例化express
const app = express()
// 引入打印文件助手
const {HandleLogs} = require('./utils')
// 引入端口号
const {SERVER_PORT} = require('./config')
// 引入路由包
const {Router} = require('./router')
// 对返回数据进行json处理
app.use(express.json())
app.use(express.urlencoded({extends:false}))
app.use(express.static(path.join(__dirname,'static'),{index:'login.html'}))

// 对端口号进行监听
app.listen(SERVER_PORT,() => {
    HandleLogs(`server started on port ${SERVER_PORT}`)
})

 // 用户登录 post 请求
 Router(app)